How to determine if there is a specific short integer variable value in the array?How do you sort a dictionary by value?How do you give a C# Auto-Property a default value?Adding values to a C# arrayHow do you convert a byte array to a hexadecimal string, and vice versa?How to loop through all enum values in C#?How to determine if a decimal/double is an integer?Databinding issue with stopwatched elapsedHow to determine if a type implements an interface with C# reflectionPass an array of integers to ASP.NET Web API?How to convert byte array to string
How would two worlds first establish an exchange rate between their currencies
Starring Samurais - Several Scribbled Short Stories
Where does the expression "triple-A" comes from?
Are there any space probes or landers which regained communication after being lost?
How to split a string by the third .(dot) delimiter
Is there a standard terminology for female equivalents of terms such as 'Kingdom' and if so, what are the most common terms?
Might have gotten a coworker sick, should I address this?
My favorite color is blue what is your favorite color?
Two different colors in an Illustrator stroke / line
Number of aircraft to operate in an airline company
What is going on: C++ std::move on std::shared_ptr increases use_count?
Is there any detail about ambulances in Star Wars?
SQL Server table with 4,000,000 rows is 40GB
Procedure for traffic not in sight
CBP interview, how serious should I take it?
I see your BIDMAS and raise you a BADMIS
What was the first LISP compiler?
Does the word “uzi” need to be capitalized?
Is it appropriate for a professor to require students to sign a non-disclosure agreement before being taught?
Why should I always enable compiler warnings?
Is the space of Radon measures a Polish space or at least separable?
Are programming languages necessary/useful for operations research practitioner?
Could the government trigger by-elections to regain a majority?
Is BitLocker useful in the case of stolen laptop?
How to determine if there is a specific short integer variable value in the array?
How do you sort a dictionary by value?How do you give a C# Auto-Property a default value?Adding values to a C# arrayHow do you convert a byte array to a hexadecimal string, and vice versa?How to loop through all enum values in C#?How to determine if a decimal/double is an integer?Databinding issue with stopwatched elapsedHow to determine if a type implements an interface with C# reflectionPass an array of integers to ASP.NET Web API?How to convert byte array to string
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have an array of integers, and a short integer variable, I want to know if the value of this short integer exists in the array.
I tried using Contains, but I don't support short integer variables, so I can't help it.
public List<Client> GetLogList(string userId,
string flagId,
string itemId,
int[] labIds,
string deviceId,
int[] actionType,
int? signStatus,
DateTime? startDate,
DateTime? endDate,
int pageIndex,
int pageSize)
DB.Queryable<Client, User, Item, Flag, ClientDevice, LogItem>
((clientOp, labUser, labItem, rfidFlag, clientDev, labUseLog) =>
clientOp.DeviceId == clientDev.DeviceId
&& clientOp.Operator == labUser.UserId
&& clientOp.FlagId == rfidFlag.FlagId
&& rfidFlag.ItemId == labItem.ItemId
&& clientOp.Id == labUseLog.Id)
.WhereIF(!string.IsNullOrEmpty(userId), clientOp =>
clientOp.Operator == userId)
.WhereIF(!string.IsNullOrEmpty(flagId), clientOp =>
clientOp.FlagId == flagId)
.WhereIF(!string.IsNullOrEmpty(itemId), rfidFlag =>
rfidFlag.ItemId == Convert.ToInt32(itemId))
.WhereIF(!string.IsNullOrEmpty(deviceId), clientOp =>
clientOp.DeviceId == deviceId)
.WhereIF(actionType != null && actionType.Count() > 0,
clientOp => clientOp.ActionType.Contains(actionType)))
c#
add a comment |
I have an array of integers, and a short integer variable, I want to know if the value of this short integer exists in the array.
I tried using Contains, but I don't support short integer variables, so I can't help it.
public List<Client> GetLogList(string userId,
string flagId,
string itemId,
int[] labIds,
string deviceId,
int[] actionType,
int? signStatus,
DateTime? startDate,
DateTime? endDate,
int pageIndex,
int pageSize)
DB.Queryable<Client, User, Item, Flag, ClientDevice, LogItem>
((clientOp, labUser, labItem, rfidFlag, clientDev, labUseLog) =>
clientOp.DeviceId == clientDev.DeviceId
&& clientOp.Operator == labUser.UserId
&& clientOp.FlagId == rfidFlag.FlagId
&& rfidFlag.ItemId == labItem.ItemId
&& clientOp.Id == labUseLog.Id)
.WhereIF(!string.IsNullOrEmpty(userId), clientOp =>
clientOp.Operator == userId)
.WhereIF(!string.IsNullOrEmpty(flagId), clientOp =>
clientOp.FlagId == flagId)
.WhereIF(!string.IsNullOrEmpty(itemId), rfidFlag =>
rfidFlag.ItemId == Convert.ToInt32(itemId))
.WhereIF(!string.IsNullOrEmpty(deviceId), clientOp =>
clientOp.DeviceId == deviceId)
.WhereIF(actionType != null && actionType.Count() > 0,
clientOp => clientOp.ActionType.Contains(actionType)))
c#
You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?
– James Zhang
Mar 28 at 8:51
I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.
– Damien_The_Unbeliever
Mar 28 at 8:52
Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.
– James Zhang
Mar 28 at 9:00
And it wasn't just to writeactionType.Contains(clientOp.ActionType)
?
– Damien_The_Unbeliever
Mar 28 at 9:31
add a comment |
I have an array of integers, and a short integer variable, I want to know if the value of this short integer exists in the array.
I tried using Contains, but I don't support short integer variables, so I can't help it.
public List<Client> GetLogList(string userId,
string flagId,
string itemId,
int[] labIds,
string deviceId,
int[] actionType,
int? signStatus,
DateTime? startDate,
DateTime? endDate,
int pageIndex,
int pageSize)
DB.Queryable<Client, User, Item, Flag, ClientDevice, LogItem>
((clientOp, labUser, labItem, rfidFlag, clientDev, labUseLog) =>
clientOp.DeviceId == clientDev.DeviceId
&& clientOp.Operator == labUser.UserId
&& clientOp.FlagId == rfidFlag.FlagId
&& rfidFlag.ItemId == labItem.ItemId
&& clientOp.Id == labUseLog.Id)
.WhereIF(!string.IsNullOrEmpty(userId), clientOp =>
clientOp.Operator == userId)
.WhereIF(!string.IsNullOrEmpty(flagId), clientOp =>
clientOp.FlagId == flagId)
.WhereIF(!string.IsNullOrEmpty(itemId), rfidFlag =>
rfidFlag.ItemId == Convert.ToInt32(itemId))
.WhereIF(!string.IsNullOrEmpty(deviceId), clientOp =>
clientOp.DeviceId == deviceId)
.WhereIF(actionType != null && actionType.Count() > 0,
clientOp => clientOp.ActionType.Contains(actionType)))
c#
I have an array of integers, and a short integer variable, I want to know if the value of this short integer exists in the array.
I tried using Contains, but I don't support short integer variables, so I can't help it.
public List<Client> GetLogList(string userId,
string flagId,
string itemId,
int[] labIds,
string deviceId,
int[] actionType,
int? signStatus,
DateTime? startDate,
DateTime? endDate,
int pageIndex,
int pageSize)
DB.Queryable<Client, User, Item, Flag, ClientDevice, LogItem>
((clientOp, labUser, labItem, rfidFlag, clientDev, labUseLog) =>
clientOp.DeviceId == clientDev.DeviceId
&& clientOp.Operator == labUser.UserId
&& clientOp.FlagId == rfidFlag.FlagId
&& rfidFlag.ItemId == labItem.ItemId
&& clientOp.Id == labUseLog.Id)
.WhereIF(!string.IsNullOrEmpty(userId), clientOp =>
clientOp.Operator == userId)
.WhereIF(!string.IsNullOrEmpty(flagId), clientOp =>
clientOp.FlagId == flagId)
.WhereIF(!string.IsNullOrEmpty(itemId), rfidFlag =>
rfidFlag.ItemId == Convert.ToInt32(itemId))
.WhereIF(!string.IsNullOrEmpty(deviceId), clientOp =>
clientOp.DeviceId == deviceId)
.WhereIF(actionType != null && actionType.Count() > 0,
clientOp => clientOp.ActionType.Contains(actionType)))
c#
c#
edited Mar 28 at 8:48
Joel
1,41514 silver badges29 bronze badges
1,41514 silver badges29 bronze badges
asked Mar 28 at 8:26
James ZhangJames Zhang
1
1
You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?
– James Zhang
Mar 28 at 8:51
I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.
– Damien_The_Unbeliever
Mar 28 at 8:52
Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.
– James Zhang
Mar 28 at 9:00
And it wasn't just to writeactionType.Contains(clientOp.ActionType)
?
– Damien_The_Unbeliever
Mar 28 at 9:31
add a comment |
You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?
– James Zhang
Mar 28 at 8:51
I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.
– Damien_The_Unbeliever
Mar 28 at 8:52
Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.
– James Zhang
Mar 28 at 9:00
And it wasn't just to writeactionType.Contains(clientOp.ActionType)
?
– Damien_The_Unbeliever
Mar 28 at 9:31
You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?
– James Zhang
Mar 28 at 8:51
You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?
– James Zhang
Mar 28 at 8:51
I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.
– Damien_The_Unbeliever
Mar 28 at 8:52
I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.
– Damien_The_Unbeliever
Mar 28 at 8:52
Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.
– James Zhang
Mar 28 at 9:00
Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.
– James Zhang
Mar 28 at 9:00
And it wasn't just to write
actionType.Contains(clientOp.ActionType)
?– Damien_The_Unbeliever
Mar 28 at 9:31
And it wasn't just to write
actionType.Contains(clientOp.ActionType)
?– Damien_The_Unbeliever
Mar 28 at 9:31
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55393022%2fhow-to-determine-if-there-is-a-specific-short-integer-variable-value-in-the-arra%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55393022%2fhow-to-determine-if-there-is-a-specific-short-integer-variable-value-in-the-arra%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You can see the last piece of code. "ClientOp.ActionType" is a short integer variable. "actiontype" is an array of integers. I want to know if there is a short integer value in the array, but I can't use Contains. So I want to know if there is a way to solve my problem?
– James Zhang
Mar 28 at 8:51
I think you're just doing things the wrong way around, from your description. At the moment, you're trying to write code that asks "does this short integer variable contain this int array?" which doesn't match what you've narratively said you're trying to do.
– Damien_The_Unbeliever
Mar 28 at 8:52
Sorry, my English is not very good, so I may not express my meaning. I have found a solution to this problem. There is a method in the ORM framework that can help me solve this problem. Thank you.
– James Zhang
Mar 28 at 9:00
And it wasn't just to write
actionType.Contains(clientOp.ActionType)
?– Damien_The_Unbeliever
Mar 28 at 9:31