0
SELECT * FROM register WHERE user_id LIKE 'a%'

SELECT * FROM register WHERE user_id LIKE '%m'

SELECT * FROM register WHERE user_id LIKE '%andru%'


SELECT R.name,C.country_name,S.state_name 
FROM register R JOIN country C ON R.country_id=C.country_id
JOIN state S  ON R.state_id=S.state_id

SELECT R.name,C.country_name,S.state_name 
FROM register R INNER JOIN country C ON R.country_id=C.country_id       
INNER JOIN state S ON R.state_id=S.state_id

Now i need LinqToSql Queries instead of these query

4

1 Answer 1

1
var result = context.Registers.Select(x => x.StartsWith(foo)).ToList();

result = context.Registers.Select(x => x.EndsWith(foo)).ToList();

result = context.Registers.Select(x => x.Contains(foo)).ToList();

result = from register in context.Registers
         join state in context.States on register.state_id equals state.state_id
         select new { register.name, state.country_name, state.state_name }

Note, inner join and join function the same in SQL — thus no need to complicate.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.