expression Questions

6

Solved

I have a filter that I use across many methods: Expression<Func<Child, bool>> filter = child => child.Status == 1; (actually is more complex than that) And I have to do the follo...
Beriberi asked 27/4, 2012 at 19:44

4

Solved

Starting from C# 7.0 the throw keyword can be used both as an expression and as a statement, which is nice. Though, consider these overloads public static void M(Action doIt) { /*use doIt*/ } publi...
Hekking asked 15/1, 2019 at 23:8

3

Solved

I'm trying to return the result of a entity framework query into my own dto class, at the same time as mapping my enum TradeType. I'm getting the following error The specified value is not an ins...

3

Solved

I have read many postings on this topic using expression(), paste(), and bquote(), or some combination. I think I am close to solving my problem, but I just can't get there. The following script ge...
Ulphiah asked 4/12, 2018 at 20:4

3

Solved

I would like to use substitute() to do variable substitutions inside expressions, without evaluating the expressions. For example, I have: expr1 <- expression(if(x){ return(y) } else { return...
Winthrop asked 13/7, 2015 at 1:23

1

Most examples deal with the book store example from Stefan Gössner, however I'm struggling to define the correct JsonPath expression for a simple object (no array): { "Id": 1, "Name": "Test" } T...
Aesthetic asked 24/3, 2018 at 7:6

5

I found this example and I can't understand why it works unpredictably? I supposed it must output [1, 8, 15] or [2, 8, 22]. array = [1, 8, 15] g = (x for x in array if array.count(x) > 0) array ...
Grandmamma asked 24/10, 2018 at 11:52

6

Solved

I have the variable assignment in order to return the assigned value and compare that to an empty string, directly in the while loop. Here is how I'm doing it in PHP: while((name = raw_input("Nam...
Directly asked 12/2, 2009 at 16:44

6

Given an expression '(lambda (x) x) How can I translate this into a string. I thought symbol->string will do the job but no it cant not a symbol. e.g for a macro to-string: (to-string (lambda(x) ...
Kelseykelsi asked 2/11, 2009 at 0:34

1

Solved

I have the following code: int main() { int i=0; int j=({int k=3;++i;})+1; // this line return 0; } It compiles and runs. If I remove the () from "this line", then it doesn't compile. ...
Chauffeur asked 13/9, 2018 at 11:56

1

Solved

I have the following function which is actually a wrapper around Z.EntityFramework.Plus bulk update: public static int UpdateBulk<T>(this IQueryable<T> query, Expression<Func<T,...
Ultracentrifuge asked 23/8, 2018 at 1:33

1

Solved

Is this Undefined Behavior under C? I say this because I think that the function inc(int *k) can be thought of as an expression whose side effect is to update the value at the address of k. So, wou...
Rarefied asked 23/8, 2018 at 1:54

2

I have an entity framework query that I inherited which includes several Sums, cutdown example:- from c in db.Clients where {where clauses} select new { ClientID = c.ClientID, ClientName = c.Clien...
Bradleybradly asked 19/7, 2018 at 11:58

4

Solved

F#'s Condtional Expressions require a condition to check, a branch for true, and a branch for false. For example: let x = if ("hello" = null) then true else false //error if else branch missi...
Orta asked 13/7, 2018 at 13:36

2

Solved

I am using Symfony 3 and I've created a custom Voter class. I want to access it using the SensioFrameworkExtraBundle @Security tag. It kind of works. If I do the following it works perfectly: ...
Antiquate asked 16/6, 2017 at 13:52

3

Solved

I'm trying to build a parser of expressions to Odata, and i'm getting an error, when the field is nullable. public class UserRight { public bool? active } public void Test(){ Expression<Func...
Imidazole asked 29/5, 2018 at 17:12

1

Solved

I want to use subscripts within each factor in a ggplot barplot. d = structure(list(env = structure(c(1L, 3L, 4L, 2L, 5L, 7L, 6L), .Label = c("mean SS", "50% O2 @ 25 °C", "50% O2 @ 0 °C", "50% O2...
Trim asked 25/5, 2018 at 4:45

3

Why can't I do this: d = [x for x in range(7)] a, b, c, d, e, f, g = *d Where is it possible to unpack? Only between parentheses of a function?
Cadmarr asked 2/5, 2018 at 9:22

5

Solved

I have stored values in my database that look like 5XXXXXX, where X can be any digit. In other words, I need to match incoming SQL query strings like 5349878. Does anyone have an idea how to do i...
Nidorf asked 26/12, 2009 at 19:22

2

Solved

public class Model1 { public String Value { get; set; } } public class Model2 { public dynamic Value { get; set; } } public static Expression<Func<Model2, Model1>> GetExpression() {...
Tiffaneytiffani asked 17/4, 2018 at 11:38

3

Solved

Below, I have R code that plots a grouped bar plot. group_name = c('A_1x', 'A_1x', 'A_2x', 'A_2x', 'A_3x', 'A_3x', 'A_4x', 'A_4x') mydata2 <- data.frame(mygroup = group_name, mysubgroup = f...
Dato asked 10/6, 2016 at 22:35

2

Solved

I used this Xpath expression "//span[@class='Big']" and got all elements in that page that are under <span> tag and class='Big'. My question is what if I want just the first occurrence on th...
Intestinal asked 12/1, 2013 at 15:52

3

In Notepad++, how do you Find and Insert (instead of Find and Replace) while using a regular expression as the search criteria? For non regular expression, you can simply include what you are find...
Sirrah asked 2/3, 2012 at 22:58

2

Solved

you can easily create dynamic queries in c# if you add more restrictions to the current query. var list = new List<Item>(); var q = list.AsQueryable(); q = q.Where(x => x.Size == 3); q =...
Ventricle asked 3/9, 2013 at 16:8

2

Solved

I found they're different, and the language standard says what kind of type each statement should retrieve(difference between variable and expression). But I really wish to know why these 2 kinds o...
Paternal asked 21/2, 2017 at 9:11

© 2022 - 2024 — McMap. All rights reserved.